package com.xjy.headfirst.策略模式.作者最终设计鸭子行为;

public class Duck {

    /**
     * 接口引用
     */
    QuackBehavior quackBehavior;

    /**
     * 接口引用
     */
    FlyBehavior flyBehavior;


    public void preformQuack(){
        quackBehavior.quack();
    }

    public void preformFly(){
        flyBehavior.fly();
    }

    public void setQuackBehavior(QuackBehavior quackBehavior){
        this.quackBehavior = quackBehavior;
    }

    public void setFlyBehavior( FlyBehavior flyBehavior){
        this.flyBehavior = flyBehavior;
    }


}
